@model EditUserViewModel
@using OrchardCore.Entities
@using OrchardCore.Users.Models

@{
    var usersMustValidateEmail = Site.As<RegistrationSettings>().UsersMustValidateEmail;
}

<input asp-for="Id" type="hidden" />

<fieldset class="form-group">
    <label asp-for="UserName">@T["User name"]</label>
    <div class="input-group row col-md-4">
        <div class="input-group-prepend">
            <span class="input-group-text"><i class="fa fa-user"></i></span>
        </div>
        <input asp-for="UserName" class="form-control" autofocus />
        <span asp-validation-for="UserName" class="text-danger">@T["The user name is required."]</span>
    </div>
</fieldset>
<fieldset class="form-group" asp-validation-class-for="Email">
    <label asp-for="Email">@T["Email"]</label>
    <div class="input-group row col-md-4">
        <div class="input-group-prepend">
            <span class="input-group-text"><i class="fa fa-envelope"></i></span>
        </div>
        <input asp-for="Email" class="form-control" type="email" />
        <span asp-validation-for="Email" class="text-danger">@T["The email is invalid."]</span>
    </div>
</fieldset>

@if (Site.As<RegistrationSettings>().UsersMustValidateEmail)
{
    <fieldset class="form-group">
        <div class="custom-control custom-checkbox">
            <input asp-for="EmailConfirmed" type="checkbox" class="custom-control-input">
            <label class="custom-control-label" asp-for="EmailConfirmed">@T["Email confirmed"]</label>
        </div>
    </fieldset>
}

<h6>@T["Roles"]</h6>
<fieldset class="form-group">
    @for (var i = 0; i < Model.Roles.Length; i++)
    {
        <div class="custom-control custom-checkbox">
            <input asp-for="Roles[i].IsSelected" type="checkbox" class="custom-control-input">
            <input type="hidden" asp-for="Roles[i].Role" />
            <label class="custom-control-label" asp-for="Roles[i].IsSelected">@Model.Roles[i].Role</label>
        </div>
    }
</fieldset>